<?php

namespace App\Http\Controllers;

use App\Http\Controllers\BaseController;
use App\Modules\Admin\Services\UploadService;

class UploadController extends BaseController
{
    public function __construct(UploadService $uploadService)
    {
        $this->middleware('check.login');

        $this->uploadService = $uploadService;
    }

    public function upload()
    {
        $param = $this->validationParameter([
            'module|模块' => 'require',
            'file|文件' => 'require|file',
        ]);

        $result = $this->uploadService->upload($param);

        return $this->response->success($result);
    }

}
